package com.itcam.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Author:Cammy.Wu
 * Date:2024-04-30
 * Description:mvc组件的配置类
 */

@Configuration
@ComponentScan("com.itcam.jsp")
@EnableWebMvc
public class MvcConfig implements WebMvcConfigurer {
    // handlerMapping handlerAdapter json转化器
    // 视图解析器，指定前后缀


    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        // registry可以快速添加前后缀
        registry.jsp("/WEB-INF/views/",".jsp");
        // handler -> index
    }
}
